//
//	MyError.swift
//
//	Create by 松 松 on 29/10/2018
//	Copyright © 2018. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation 
import ObjectMapper


open class MyError : NSObject, NSCoding, Mappable,Error{

	public var error : String?
	public var message : String?
	public var path : String?
	public var status : Int?
	public var timestamp : String?


	class func newInstance(map: Map) -> Mappable?{
		return MyError()
	}
    required public init?(map: Map){}
	override init(){}

    public func mapping(map: Map)
	{
		error <- map["error"]
		message <- map["message"]
		path <- map["path"]
		status <- map["status"]
		timestamp <- map["timestamp"]
		
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required public init(coder aDecoder: NSCoder)
	{
         error = aDecoder.decodeObject(forKey: "error") as? String
         message = aDecoder.decodeObject(forKey: "message") as? String
         path = aDecoder.decodeObject(forKey: "path") as? String
         status = aDecoder.decodeObject(forKey: "status") as? Int
         timestamp = aDecoder.decodeObject(forKey: "timestamp") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc public func encode(with aCoder: NSCoder)
	{
		if error != nil{
			aCoder.encode(error, forKey: "error")
		}
		if message != nil{
			aCoder.encode(message, forKey: "message")
		}
		if path != nil{
			aCoder.encode(path, forKey: "path")
		}
		if status != nil{
			aCoder.encode(status, forKey: "status")
		}
		if timestamp != nil{
			aCoder.encode(timestamp, forKey: "timestamp")
		}

	}

}
